package com.wn55.hrms.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wn55.hrms.entity.OverTime;
import com.wn55.hrms.mapper.OverTimeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Mr.bai~
 * @version 1.0
 * @date 2022/5/5 23:16
 */
@Service
public class OverTimeService {

    @Autowired
    OverTimeMapper overTimeMapper;


    public PageInfo<OverTime> queryChannel(Integer now, Integer size, String eName, String type) {
        PageHelper.startPage(now,size);

        List<OverTime> list = overTimeMapper.selectConds(eName,type);
        return new PageInfo<>(list);
    }

    public void removeBykey(int id) {
        overTimeMapper.deleteByPrimaryKey(id);
    }

    public void addOverTime(OverTime overTime) {
        overTimeMapper.insertOverTime(overTime);
    }

    public void modifyOverTime(OverTime overTime) {
        overTimeMapper.updateByPrimaryKey(overTime);
    }
}
